<%--
  Created by IntelliJ IDEA.
  User: tugou
  Date: 2017/5/8
  Time: 22:49
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://"
            + request.getServerName() + ":" + request.getServerPort()
            + path + "/";
%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="sf" uri="http://www.springframework.org/tags/form" %>

<html>
<head>
    <title>登录</title>
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0,user-scalable=no"
          name="viewport" id="viewport">
    <meta name="description" content="">
    <meta name="author" content="">
    <script src="<%=basePath%>js/jquery.min.js"></script>
    <script src="<%=basePath%>js/supersized.3.2.7.min.js"></script>
    <script src="<%=basePath%>js/supersized-init.js"></script>
    <script src="<%=basePath%>js/scripts.js"></script>
    <script src="<%=basePath%>js/layer/layer.js"></script>

    <!-- CSS -->
    <link rel="stylesheet" href="<%=basePath%>css/reset.css">
    <link rel="stylesheet" href="<%=basePath%>css/supersized.css">
    <link rel="stylesheet" href="<%=basePath%>css/style.css">
    <script>
        function chageCode() {
            $('#codeImage').attr('src','<%=basePath%>admin/getverifyCode?ran='+Math.random());//链接后添加Math.random，确保每次产生新的验证码，避免缓存问题。
        }
        var msg = "${msg.errmsg}";
        if(msg != null && msg != ""){
            layer.msg(msg, {
                time: 20000, //20s后自动关闭
                btn: [ '确定']
            });
        }
    </script>
</head>
<body>
<div class="page-container">
    <h1>登录</h1>
    <form action="<%=basePath%>admin/sysLogin" method="post">
        <input type="text" name="loginName" class="username" placeholder="用户名">
        <input type="password" name="userPwd" class="password" placeholder="密码">
        <div class="verifdiv">
            <input type="text" name="verifyCode" class="verifyCode" placeholder="验证码">
            <img type="image" src="<%=basePath%>admin/getverifyCode" id="codeImage" onclick="chageCode()" title="获取验证码" style="cursor:pointer;"/>
        </div>
        <button type="submit">登录</button>
        <div class="error"><span>+</span></div>
    </form>
</div>
</body>
</html>
